home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World Interactive 7
/
PC World Interactive 7.iso
/
program
/
ctutord.EXE
/
LOGIC.C
< prev
next >
Wrap
C/C++ Source or Header
|
1990-10-01
|
543b
|
38 lines
#include "stdio.h"
#define EQ 1
#define LESS 2
#define GREAT 3
typedef int logic;
logic nequal(int, int);
logic equal(int, int);
logic greater(int, int);
main()
{
int a=100, b=100;
if( equal(a,b) )
printf("A and B are EQUAL\n");
a-=10;
if( nequal(a,b) )
printf("A IS NOT EQUAL TO B\n");
a+=20;
if( greater(a,b) )
printf("A IS GREATER THEN B\n");
}
logic equal(int x, int y)
{
return(x==y);
}
logic nequal(int x, int y)
{
return(x!=y);
}
logic greater(int x, int y)
{
return(x>y);
}